#include <iostream>
#include <unistd.h>
#include <signal.h>

 void sigcb(int sig){
    std::cout<<"signal 是："<<sig<<std::endl;
 }
int main(){
    struct sigaction ss,old;
    sigset_t st1,st2;
    sigemptyset(&st1);
    ss.sa_mask=st1;
    ss.sa_handler=sigcb;
    sigaction(SIGINT,&ss,&old);
    while(1){
        sleep(1);
        std::cout<<"我在等待信号"<<std::endl;    }
    return 0;
}